package com.test.demo.security.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.view.RedirectView;

@Controller
@RequestMapping("/")
@Tag(name = "首页接口") // Swagger/OpenAPI 注解
public class Swagger2Controller {
    @GetMapping("/")
    @Operation(summary = "应用首页", description = "重定向到Swagger UI文档页面")
    public RedirectView index() {
        return new RedirectView("/swagger-ui.html");
    }

    @GetMapping("/swagger")
    @Operation(summary = "Swagger文档页面", description = "重定向到Swagger UI文档页面")
    public RedirectView swagger2() {
        return new RedirectView("/swagger-ui.html");
    }
}
